Get Previous Entry Date Status In Postgresql Using Lag Function - Beginners